package team.sun.sss.dao.hardwork;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import team.sun.sss.pojo.hardwork.HwContent;

import java.util.List;
@Mapper
@Repository
public interface HwContentDao {
    //该内容包含在用人单位申请表里面
    //1.显示某用人单位申请表批次的内容，相同的为图书馆单位的
    @Select("select * from hw_work_content where labor_unit=#{laborUnit} and batch_team=#{batchTeam} ")
    List<HwContent> getHwContentList(String laborUnit,String batchTeam);

    //2.添加工作内容
    @Insert("insert into hw_work_content(hw_content_content,hw_content_time,hw_content_hours,labor_unit,batch_team) values" +
            "(#{hwContentContent},#{hwContentTime},#{hwContentHours},#{laborUnit},#{batchTeam})")
    int addHwContent(String hwContentContent,String hwContentTime,String hwContentHours,String laborUnit,String batchTeam);
    //3.删除工作内容,当前方法不可行，会将所有相同的都删除
    @Delete("delete from hw_work_content where batch_team=#{batchTeam}  and batch_team=#{laborUnit}")
    int deleteHwContent( String laborUnit,String batchTeam);


}
